home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Entertainment Pack
/
SoftKey Entertainment Pack (Games and Multimedia)(SoftKey Multimedia)(NEW844AE-CD2)(1996).ISO
/
game2000.mst
< prev
next >
Wrap
Text File
|
1995-09-28
|
11KB
|
367 lines
'**************************************************************************
'* CD Explorer Setup Script
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST LICENSE = 150
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST OPTIONS = 800
CONST APPHELP = 900
CONST LAUNCH = 1000
CONST BADPATH = 6400
CONST EXTENDEDLIST = 3900
CONST NEWERVERINSTALLED = 7801
''Bitmap ID
CONST LOGO = 1
GLOBAL DEST$ ''Default destination directory.
GLOBAL CDROMDRV$ ''CD-ROM Drive Letter.
GLOBAL OPTCUR$ ''Option selection from option dialog.
CONST WS_VISIBLE = &H10000000
CONST WS_BORDER = &H00800000
CONST WS_CLIPCHILDREN = &H02000000
CONST GWL_STYLE = -16
CONST SW_SHOWMAXIMIZED = 3
CONST FN_INF = "GAME2000.INF"
CONST SZ_TITLE = "CD Interface Setup"
CONST SZ_GROUPNAME = "2000 Shareware Games!"
CONST FN_INIDATA = "GAME2000.INI"
CONST FN_HELPFILE = "GAME2000.HLP"
CONST FN_EXE = "GAME2000.EXE"
GLOBAL FN_INI$ ' INI Filename (for product)
GLOBAL FN_ICON$ ' Icon Filename (no path)
GLOBAL SZ_DBF$ ' Database Filename (no path)
GLOBAL SZ_PRODUCT$ ' Product Title
GLOBAL SZ_LMICD_ID$ ' LMI CD identifier
GLOBAL SZ_LMICD_TITLE$ ' LMI CD product title
GLOBAL SZ_LMICD_CDTITLE$ ' LMI CD label on CD
GLOBAL SZ_LMICD_PRODUCTLINE$ ' LMI CD product line
DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%, iShow%) AS INTEGER
DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
DECLARE SUB Install
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION WinHelp LIB "User" (hWnd%, lpHelpFile$, wCommand%, dwData&) As INTEGER
DECLARE FUNCTION WinExec Lib "Kernel" (lpCmdLine$, nCmdShow%) As INTEGER
INIT:
hWnd%=HwndFrame()
i1&=SetWindowLong(hWnd%, GWL_STYLE, WS_VISIBLE + WS_BORDER + WS_CLIPCHILDREN)
j1%=ShowWindow(hWnd%, SW_SHOWMAXIMIZED)
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle SZ_TITLE
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + FN_INF
END IF
ReadInfFile szInf$
OPTCUR$ = "1"
' DEST$ = SZ_DEST
CDROMDRV$ = MID$(GetSymbolValue("STF_SRCDIR"), 1, 1) + ":"
' Read from PLATINUM.INI File
ini$ = MakePath(CDROMDRV$, FN_INIDATA)
FN_INI$ = GetIniKeyString (ini$, "Settings", "INIFile")
FN_ICON$ = GetIniKeyString (ini$, "Setup Information", "Icon")
DEST$ = GetIniKeyString (ini$, "Setup Information", "Destination")
SZ_DBF$ = GetIniKeyString (ini$, "Setup Information", "Database")
SZ_PRODUCT$ = GetIniKeyString (ini$, "Product", "Title")
SZ_LMICD_ID$ = GetIniKeyString (ini$, "Setup Information", "LMICD_ID")
SZ_LMICD_TITLE$ = GetIniKeyString (ini$, "Setup Information", "LMICD_Title")
SZ_LMICD_CDTITLE$ = GetIniKeyString (ini$, "Setup Information", "LMICD_CDTitle")
SZ_LMICD_PRODUCTLINE$ = GetIniKeyString (ini$, "Setup Information", "LMICD_PRODUCTLINE")
i% = SetSizeCheckMode(scmOff)
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
WinDrive$ = MID$(GetWindowsDir, 1, 1)
IF IsDriveValid(WinDrive$) = 0 THEN
i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
GOTO QUIT
END IF
'$ENDIF 'DEBUG
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
LICENSE:
sz$ = UIStartDlg(CUIDLL$, LICENSE, "FConfirmDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSEIF sz$ = "LICENSE" THEN
i = WinHelp(hWnd%, MakePath(CDROMDRV$, FN_HELPFILE), 1, 900)
GOTO LICENSE
ELSEIF sz$ = "REACTIVATE" THEN
GOTO LICENSE
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO WELCOME
ELSE
GOSUB ASKQUIT
GOTO LICENSE
END IF
IF DoesFileExist (MakePath(GetWindowsDir, FN_INI$), femExist) = 1 THEN
iCurrentVer = Val(GetIniKeyString (MakePath(CDROMDRV$, FN_INIDATA), "Product", "Release"))
iInstalledVer = Val(GetIniKeyString (MakePath(GetWindowsDir, FN_INI$), "Product", "Release"))
If iCurrentVer < iInstalledVer Then
NEWERVERINSTALLED:
sz$ = UIStartDlg(CUIDLL$, NEWERVERINSTALLED, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO LICENSE
ELSE
GOSUB ASKQUIT
GOTO NEWERVERINSTALLED
END IF
End If
END IF
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
DEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO LICENSE
ELSE
GOSUB ASKQUIT
GOTO GETPATH
END IF
Install
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
IF dlg% = EXITSUCCESS THEN
LAUNCH:
sz$ = UIStartDlg(CUIDLL$, LAUNCH, "FConfirmDlgProc", APPHELP, HELPPROC$)
IF sz$ = "RUN" THEN
i = WinExec (MakePath(CDROMDRV$, FN_EXE), 1)
ELSEIF sz$ = "REACTIVATE" THEN
GOTO LAUNCH
END IF
UIPop 1
END IF
END
ERRQUIT:
i% = DoMsgBox("Setup sources were corrupted. Please try cleaning the CD-ROM and then run setup again.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
'**
'** Purpose:
'** Builds the copy list and performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir DEST$, cmoNone
SetCopyGaugePosition 76, 130
OpenLogFile MakePath(DEST$, "GAME2000.ILG"), 0
WriteToLogFile ""
WriteToLogFile " User chose as destination directory: '" + DEST$ + "'"
WriteToLogFile ""
WriteToLogFile "May have had to create the directory: " + DEST$
WriteToLogFile ""
AddSectionKeyFileToCopyList "Main", "1", SrcDir$, DEST$
AddSectionKeyFileToCopyList "Dynalinks", "1", SrcDir$, GetWindowsSysDir
CopyFilesInCopyList
' Create INI File
ini$ = MakePath(GetWindowsDir, FN_INI$)
CreateIniKeyValue ini$, "Settings", "PlayFlic", "-1", cmoOverwrite
CreateIniKeyValue ini$, "Settings", "VerifyOnExit", "-1", cmoNone
CreateIniKeyValue ini$, "Settings", "PlayButtonSound", "-1", cmoNone
CreateIniKeyValue ini$, "Settings", "VerifyDelete", "-1", cmoNone
CreateIniKeyValue ini$, "Settings", "MinimizeOnLaunch", "0", cmoNone
CreateIniKeyValue ini$, "Paths", "Database", MakePath(DEST$, SZ_DBF$), cmoOverwrite
CreateIniKeyValue ini$, "Options", "SystemDB", MakePath(DEST$, "system.mda"), cmoOverwrite
CreateIniKeyValue ini$, "Product", "Title", GetIniKeyString (MakePath(CDROMDRV$, FN_INIDATA), "Product", "Title"), cmoOverwrite
CreateIniKeyValue ini$, "Product", "Release", GetIniKeyString (MakePath(CDROMDRV$, FN_INIDATA), "Product", "Release"), cmoOverwrite
CreateIniKeyValue ini$, "Product", "ReleaseText", GetIniKeyString (MakePath(CDROMDRV$, FN_INIDATA), "Product", "ReleaseText"), cmoOverwrite
' Write AutoStart/32 Settings
CreateIniKeyValue ini$, "Auto Start", "Setting", "2", cmoOverwrite
CreateIniKeyValue ini$, "Auto Start", "NumFiles", "0", cmoOverwrite
CreateIniKeyValue ini$, "Auto Start", "EXE", FN_EXE, cmoOverwrite
CreateIniKeyValue ini$, "Product", "Release", GetIniKeyString (MakePath(CDROMDRV$, FN_INIDATA), "Product", "Release"), cmoOverwrite
CreateIniKeyValue ini$, "Product", "ReleaseText", GetIniKeyString (MakePath(CDROMDRV$, FN_INIDATA), "Product", "ReleaseText"), cmoOverwrite
' Create LMICD.INI File, store information in it...
ini$ = MakePath(GetWindowsDir, "LMICD.INI")
CreateIniKeyValue ini$, SZ_LMICD_ID$, "Title", SZ_LMICD_TITLE$, cmoOverwrite
CreateIniKeyValue ini$, SZ_LMICD_ID$, "CDTitle", SZ_LMICD_CDTITLE$, cmoOverwrite
CreateIniKeyValue ini$, SZ_LMICD_ID$, "ProductLine", SZ_LMICD_PRODUCTLINE$, cmoOverwrite
CreateIniKeyValue ini$, SZ_LMICD_ID$, "WorkingDir", CDROMDRV$ + "\", cmoOverwrite
CreateProgmanGroup SZ_GROUPNAME, "", cmoNone
ShowProgmanGroup SZ_GROUPNAME, 1, cmoNone
CreateProgmanItem SZ_GROUPNAME, SZ_PRODUCT$, MakePath(CDROMDRV$, FN_EXE), MakePath(DEST$,FN_ICON$)+",0,0,0,", cmoOverwrite
CreateProgmanItem SZ_GROUPNAME, SZ_PRODUCT$ + " Help", "winhelp.exe " + MakePath(CDROMDRV$,FN_HELPFILE), MakePath(DEST$,FN_ICON$)+",0,0,0,"+CDROMDRV$ + "\", cmoOverwrite
CloseLogFile
END SUB
'**
'** Purpose:
'** Appends a file name to the end of a directory path,
'** inserting a backslash character as needed.
'** Arguments:
'** szDir$ - full directory path (with optional ending "\")
'** szFile$ - filename to append to directory
'** Returns:
'** Resulting fully qualified path name.
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION